
#include "headfile.h"

idata uint16 test_u16, i;
idata float  test_f = 0.25;
idata uint8  test_str[20];

void main()
{
    uint16 adc_data = 0;
    DisableGlobalIRQ();
    board_init();

    OLED_Init();

    EnableGlobalIRQ();

    OLED_PutChinese ( 10, 0, 1 , INVERTCOLORMODE);
    OLED_PutChinese ( 10 + 16 * 1, 0, 2 , INVERTCOLORMODE);
    OLED_PutChinese ( 10 + 16 * 2, 0, 3 , INVERTCOLORMODE);
    OLED_PutChinese ( 10 + 16 * 3, 0, 4 , INVERTCOLORMODE);
    OLED_PutChinese ( 10 + 16 * 4, 0, 5 , INVERTCOLORMODE);
    OLED_PutChinese ( 10 + 16 * 5, 0, 6 , INVERTCOLORMODE);
    pca_delay_ms ( 2000 );
    OLED_Clear();//清屏
    OLED_PutStr6x8(8, 1, "HelloWorld", INVERTCOLORMODE);
    OLED_PutStr8x16(8, 3, "Hello", INVERTCOLORMODE);
    pca_delay_ms ( 2000 );
    OLED_Clear();//清屏
    pca_delay_ms ( 20 );
    OLED_Draw_BMP ( 35, 0, 35 + 58, 8, AiThink, INVERTCOLORMODE);
    pca_delay_ms ( 2000 );
    OLED_Clear();//清屏
    for (i = 0; i < 100; i++)
    {
        test_u16 += 20;
        sprintf(test_str, "u16=%04d", test_u16);
        OLED_PutStr8x16(2, 1, test_str, NOMALCOLORMODE); pca_delay_ms ( 50 );
    }
    OLED_Clear();//清屏
    for (i = 0; i < 100; i++)
    {
        test_f += 0.12;
        sprintf(test_str, "f=%06.2f", test_f);
        OLED_PutStr8x16(2, 1, test_str, NOMALCOLORMODE); pca_delay_ms ( 50 );
    }
    OLED_Clear();//清屏
    while ( 1 )
    {
        pca_delay_ms ( 20000 );
    }
}












